import pandas as pd
from pyecharts import options as opts
from pyecharts.charts import Map
df=pd.read_excel('2022年咸宁市各县级行政区国内生产总值.xlsx')
map=Map(init_opts=opts.InitOpts(
    width='800px',height='600px',page_title='统计地图'
))
map.add(series_name='',data_pair=df.values.tolist(),maptype='石家庄',
        label_opts=opts.LabelOpts(
            formatter='{b}({c}亿元)'
        ))
map.set_global_opts(
    title_opts=opts.TitleOpts(
        title='2020年石家庄行政区内生产总值图',
        pos_left='center'
    ),
    legend_opts=opts.LegendOpts(is_show=False),
    visualmap_opts=opts.VisualMapOpts(
        max_=1580,min_=155,pos_top='65%'
    )
)
map.render('9-1.html')